#include "StreamWriter.h"

void StreamWriter::WriteByte(std::ostream &os, BYTE val)
{
	os.write((char*)&val, sizeof(val));
	os.flush();
}

void StreamWriter::WriteChar(std::ostream &os, char val)
{
	os.write((char*)&val, sizeof(val));
	os.flush();
}

void StreamWriter::WriteInt(std::ostream &os, int val)
{
	os.write((char*)&val, sizeof(val));
	os.flush();
}

void StreamWriter::WriteFloat(std::ostream &os, float val)
{
	os.write((char*)&val, 4);
	os.flush();
}

void StreamWriter::WriteDword(std::ostream &os, DWORD val)
{
	os.write((char*)&val, sizeof(val));
	os.flush();
}

void StreamWriter::WriteBuffer(std::ostream &os, void *val, int size)
{
	os.write((char*)val, size);
	os.flush();
}
